import cv2
import numpy as np
import numpy as pd

def callback():
    pass

cv2.namedWindow("trackBar", cv2.WINDOW_NORMAL)

cv2.createTrackbar("r", "trackBar", 0, 255, callback)
cv2.createTrackbar("g", "trackBar", 0, 255, callback)
cv2.createTrackbar("b", "trackBar", 0, 255, callback)

img = np.zeros((480, 640, 3), np.uint8)

while True:

    r = cv2.getTrackbarPos('r', "trackBar")
    g = cv2.getTrackbarPos('g', "trackBar")
    b = cv2.getTrackbarPos('b', "trackBar")

    img[:] = [b, g, r]
    cv2.imshow("trackBar", img)

    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break
cv2.destroyAllWindows()
